<?php
namespace app\mall\logic;

use think\facade\Db;

class announcementLogic{

    /**
     * 公告列表
     */
    public function announcement_list(){
        return Db::table('one_announcement')
            ->order('up_time','desc')
            ->select();
    }

    /**
     * 问题分类
     */
    public function problem_class_list(){
        return Db::table('one_problem_class')
            ->order('create_time','desc')
            ->select();
    }

    /**
     * 问题列表
     * @param int $id
     */
    public function problem_list(int $id){
        return Db::table('one_problem')
            ->where('class_id','=',$id)
            ->order('up_time','desc')
            ->select();
    }

}